From 619ad08f6f503babbe1e0a225915647c50a3cec5 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Sun, 13 Mar 2005 09:33:37 +0000 Subject: [PATCH] bitkeeper revision 1.1159.258.53 (423408f115Ns6FbhmO7JTOAWVZjwog) Small cleanup to shutdown codes. Signed-off-by: Keir Fraser --- xen/common/domain.c | 7 +++++-- xen/include/public/io/domain_controller.h | 11 ----------- xen/include/public/xen.h | 10 ++++++++++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index f04e8bdfc7..fa07f2baf9 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -157,7 +157,7 @@ void domain_shutdown(u8 reason) extern void machine_restart(char *); extern void machine_halt(void); - if ( reason == 0 ) + if ( reason == SHUTDOWN_poweroff ) { printk("Domain 0 halted: halting machine.\n"); machine_halt(); @@ -170,7 +170,10 @@ void domain_shutdown(u8 reason) } if ( reason == SHUTDOWN_crash ) - domain_crash(); /* we will not return */ + { + domain_crash(); + BUG(); + } current->shutdown_code = reason; set_bit(DF_SHUTDOWN, ¤t->flags); diff --git a/xen/include/public/io/domain_controller.h b/xen/include/public/io/domain_controller.h index 8415132d45..c3494e34ca 100644 --- a/xen/include/public/io/domain_controller.h +++ b/xen/include/public/io/domain_controller.h @@ -10,17 +10,6 @@ #ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ #define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ - -/* - * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be - * interpreted by control software to determine the appropriate action. These - * are only really advisories: the controller can actually do as it likes. - */ -#define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */ -#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ -#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ -#define SHUTDOWN_crash 3 /* Tell controler we've crashed. */ - /* * CONTROLLER MESSAGING INTERFACE. */ diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index ff13c0fb20..f226416a94 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -176,6 +176,16 @@ #define SCHEDOP_cmdmask 255 /* 8-bit command. */ #define SCHEDOP_reasonshift 8 /* 8-bit reason code. (SCHEDOP_shutdown) */ +/* + * Reason codes for SCHEDOP_shutdown. These may be interpreted by control + * software to determine the appropriate action. For the most part, Xen does + * not care about the shutdown code (SHUTDOWN_crash excepted). + */ +#define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */ +#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ +#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ +#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ + /* * Commands to HYPERVISOR_console_io(). */ -- 2.30.2